/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    color: #2d3436;
}

/* 顶部导航栏 */
header {
    background: linear-gradient(135deg, #0097e6, #00a8ff);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

header h1 i {
    font-size: 1.8rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.user-info a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* 侧边导航栏 */
nav {
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    width: 250px;
    background: white;
    padding: 2rem 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

nav ul {
    list-style: none;
}

nav li {
    margin-bottom: 5px;
}

nav a {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: #2d3436;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    gap: 10px;
}

nav a i {
    font-size: 1.2rem;
    width: 24px;
}

nav a:hover {
    background: #f8f9fa;
    color: #0097e6;
    padding-left: 30px;
}

nav a.active {
    background: #e3f2fd;
    color: #0097e6;
    border-right: 3px solid #0097e6;
}

/* 主要内容区域 */
main {
    margin-left: 250px;
    margin-top: 60px;
    padding: 2rem;
}

/* 仪表盘卡片 */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    color: #a0aec0;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-card h3 i {
    font-size: 1.2rem;
    color: #0097e6;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 600;
    color: #2d3436;
}

/* 动画效果 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card {
    animation: slideIn 0.5s ease forwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

/* 响应式设计 */
@media (max-width: 768px) {
    nav {
        transform: translateX(-100%);
    }

    nav.active {
        transform: translateX(0);
    }

    main {
        margin-left: 0;
    }

    .dashboard {
        grid-template-columns: 1fr;
    }
} 

/* 导航菜单悬浮效果 */
nav a {
    position: relative;
    overflow: hidden;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #0097e6;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

nav a:hover::after {
    transform: translateX(0);
}

/* 统计卡片悬浮效果 */
.stat-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-card i {
    transition: transform 0.3s ease;
}

.stat-card:hover i {
    transform: scale(1.2) rotate(5deg);
}

/* 数值动画 */
.value {
    position: relative;
    display: inline-block;
}

.value::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #0097e6, transparent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.stat-card:hover .value::after {
    transform: scaleX(1);
}

/* 退出按钮动画 */
.user-info a {
    position: relative;
    overflow: hidden;
}

.user-info a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-100%) rotate(45deg);
    transition: transform 0.3s ease;
}

.user-info a:hover::before {
    transform: translateX(100%) rotate(45deg);
}

/* 添加响应式动画 */
@media (max-width: 768px) {
    .stat-card {
        transform: none !important;
    }
    
    .stat-card:hover {
        transform: translateY(-5px) !important;
    }
}

/* 添加加载动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard {
    animation: fadeInUp 0.8s ease-out;
}

/* 车位状态概览 */
.parking-overview {
    margin: 20px 0;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.parking-grid {
    display: flex;
    justify-content: space-between;
}

.parking-section {
    flex: 1;
    margin: 0 10px;
}

.parking-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.parking-spot {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.parking-spot:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.parking-spot.available {
    background: #52c41a;
}

.parking-spot.occupied {
    background: #f5222d;
}

.parking-spot.maintenance {
    background: #faad14;
}

.spot-info {
    position: absolute;
    bottom: 60px;
    left: 0;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px;
    border-radius: 5px;
    font-size: 12px;
    transition: opacity 0.3s;
    opacity: 0;
}

.parking-spot:hover .spot-info {
    opacity: 1;
}

.spot-number {
    font-size: 20px;
    font-weight: bold;
}

.spot-info {
    margin-top: 5px;
}

.spot-type {
    display: block;
    font-size: 14px;
    color: #666;
}

.spot-status {
    display: block;
    font-size: 12px;
    color: #999;
}

.btn-details {
    margin-top: 10px;
    padding: 5px 10px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.btn-details:hover {
    background: #0056b3;
}

/* 快捷搜索 */
.quick-search {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.quick-search h2 {
    font-size: 1.2rem;
    color: #2d3436;
    margin-bottom: 20px;
}

.search-form {
    display: flex;
    gap: 15px;
}

.search-input {
    flex: 1;
    position: relative;
}

.search-input i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
}

.search-input input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input input:focus {
    border-color: #0097e6;
    outline: none;
}

.search-form button {
    padding: 12px 25px;
    background: #0097e6;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-form button:hover {
    background: #00a8ff;
    transform: translateY(-2px);
}

/* 最近记录 */
.recent-records {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.recent-records h2 {
    font-size: 1.2rem;
    color: #2d3436;
    margin-bottom: 20px;
}

.record-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.record-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.record-item:hover {
    transform: translateX(5px);
    background: #f1f3f5;
}

.record-icon {
    width: 40px;
    height: 40px;
    background: #e3f2fd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.record-icon i {
    color: #0097e6;
    font-size: 1.2rem;
}

.record-content {
    flex: 1;
}

.record-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.record-time {
    font-size: 0.9rem;
    color: #868e96;
}

.record-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.record-status.entry {
    background: #d3f9d8;
    color: #2b8a3e;
}

.record-status.exit {
    background: #ffe3e3;
    color: #c92a2a;
}

.parking-spot {
    width: 60px; /* 增加宽度 */
    height: 60px; /* 增加高度 */
    border-radius: 8px; /* 圆角 */
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex; /* 使用 Flexbox 进行居中 */
    align-items: center;
    justify-content: center;
    font-weight: bold; /* 加粗字体 */
    color: #fff; /* 字体颜色 */
}

.parking-spot.available {
    background: #52c41a; /* 空闲状态颜色 */
}

.parking-spot.occupied {
    background: #f5222d; /* 占用状态颜色 */
}

.parking-spot.maintenance {
    background: #faad14; /* 维护状态颜色 */
}

.parking-spot.empty {
    background: #e0e0e0; /* 占位颜色 */
    border: 2px dashed #ccc; /* 虚线边框 */
    color: #999; /* 字体颜色 */
}

.spot-number {
    font-size: 16px; /* 调整字体大小 */
    color: #fff; /* 字体颜色 */
}

.spot-info {
    position: absolute;
    bottom: 70px; /* 显示信息的位置 */
    left: 0;
    background: rgba(255, 255, 255, 0.95); /* 背景颜色 */
    padding: 10px 15px; /* 内边距 */
    border-radius: 8px; /* 圆角 */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); /* 阴影效果 */
    font-size: 15px; /* 字体大小 */
    color: #333; /* 字体颜色 */
    transition: all 0.3s; /* 透明度变化 */
    display: none;
    z-index: 1000000; /* 确保信息在上层 */
    min-width: 220px; /* 最小宽度 */
    max-width: 250px; /* 最大宽度 */
    line-height: 1.5; /* 行高 */
    border: 1px solid #ccc; /* 边框 */
}

.parking-spot:hover .spot-info {
    display: block; /* 悬停时显示信息 */
}

/* 添加标题样式 */
.spot-info span {
    display: block; /* 每个信息占一行 */
    margin-bottom: 3px; /* 行间距 */
    font-weight: bold; /* 加粗 */
}

/* 添加描述样式 */
.spot-info .car-number,
.spot-info .user-id,
.spot-info .seat-type {
    font-weight: normal; /* 正常字体 */
    color: #555; /* 描述颜色 */
}

.parking-section {
    border: 1px solid #e0e0e0; /* 添加边框 */
    border-radius: 8px; /* 圆角 */
    background-color: #f9f9f9; /* 背景色 */
    padding: 10px; /* 内边距 */
    margin: 10px; /* 外边距 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* 阴影效果 */
}

.parking-section h3 {
    font-size: 18px; /* 增大标题字体 */
    color: #333; /* 标题颜色 */
    margin-bottom: 10px; /* 标题下方间距 */
    text-align: center; /* 标题居中 */
}

.parking-grid {
    display: flex; /* 使用 Flexbox 布局 */
    justify-content: space-between; /* 区域之间的间距 */
    flex-wrap: wrap; /* 允许换行 */
}

.status-indicators {
    display: flex; /* 使用 Flexbox 布局 */
    justify-content: flex-end; /* 右对齐 */
    margin-bottom: 10px; /* 下方间距 */
}

.status-indicator {
    display: flex;
    flex-direction: column; /* 垂直排列 */
    align-items: center; /* 水平居中 */
    margin-left: 15px; /* 左侧间距 */
}

.indicator {
    width: 20px; /* 小条宽度 */
    height: 10px; /* 小条高度 */
    border-radius: 5px; /* 圆角 */
}

.indicator.available {
    background-color: #52c41a; /* 空闲状态颜色 */
}

.indicator.occupied {
    background-color: #f5222d; /* 占用状态颜色 */
}

.indicator.maintenance {
    background-color: #faad14; /* 维护状态颜色 */
}

.status-indicator span {
    margin-top: 5px; /* 小条与文字之间的间距 */
    font-size: 14px; /* 字体大小 */
    color: #333; /* 字体颜色 */
}

/* 定义呼吸效果的动画 */
@keyframes breathing {
    0% {
        background-color: rgba(255, 99, 71, 0.3); /* 初始背景颜色 */
        transform: scale(1); /* 初始缩放 */
    }
    50% {
        background-color: rgba(255, 99, 71, 0.5); /* 中间背景颜色 */
        transform: scale(1.07); /* 中间缩放 */
    }
    100% {
        background-color: rgba(255, 99, 71, 0.3); /* 结束背景颜色 */
        transform: scale(1); /* 结束缩放 */
    }
}

/* 高亮车位样式 */
.parking-spot.highlighted {
    border: 2px solid #ff6347; /* 高亮边框颜色 */
    animation: breathing 1.5s infinite; /* 应用呼吸效果 */
    transition: background-color 0.3s, transform 0.3s; /* 背景颜色变化过渡 */
    color: #fff; /* 字体颜色 */
    border-radius: 8px; /* 圆角 */
    box-shadow: 0 4px 15px rgba(255, 99, 71, 0.5); /* 阴影效果 */
    font-weight: bold; /* 加粗字体 */
    font-size: 16px; /* 增加字体大小 */
    /* text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); 字体阴影 */
}

/* 响应式设计 */
@media (max-width: 768px) {
    .parking-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .search-form {
        flex-direction: column;
    }

    .search-form button {
        width: 100%;
        justify-content: center;
    }
}
 
